//
//  SetCountdownRemindCell.m
//  HaoHint
//
//  Created by winter on 16/5/25.
//  Copyright © 2016年 wd. All rights reserved.
//

#import "SetCountdownRemindCell.h"

@interface SetCountdownRemindCell ()

@property (weak, nonatomic) IBOutlet UILabel *remindTypeLabel;
@property (weak, nonatomic) IBOutlet UILabel *remindTimeLabel;

@end

@implementation SetCountdownRemindCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setRemindModel:(SetCountdownRemindCellModel *)remindModel
{
    _remindModel = remindModel;
    
    if (remindModel.isSecondRemind) {
        self.remindTypeLabel.text = @"第二次提醒";
    }
    else {
        self.remindTypeLabel.text = @"提醒";
    }
    self.remindTimeLabel.text = remindModel.remindTime;
}

@end

@implementation SetCountdownRemindCellModel

- (void)setRemindStyle:(RemindStyle)remindStyle
{
    _remindStyle = remindStyle;
    
    if (remindStyle < 0) {
        self.remindTime = @"无";
    }
    else if (remindStyle == 0) {
        self.remindTime = @"结束时提醒";
    }
    else if (remindStyle > 30) {
        self.remindTime = @"1小时前";
    }
    else {
        self.remindTime = [NSString stringWithFormat:@"%ld分钟前",(long)remindStyle];
    }
}
@end
